//
//  musicViewController.m
//  LastTemp
//
//  Created by dllo on 15/4/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "musicViewController.h"
#import "MVViewController.h"
#import "FMViewController.h"
#import "SingerViewController.h"
#import "SongListViewController.h"
#import "LBView.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface musicViewController ()
@end
@implementation musicViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self addButtonView];
    LBView *MV = [[LBView alloc] initWithFrame:CGRectMake(40, 114, 150, 100)];
    MV.myLabel.text = @"MV";
    [MV.myButton setBackgroundImage:[UIImage imageNamed:@"1.jpg"] forState:UIControlStateNormal];
    [MV.myButton addTarget:self action:@selector(MVClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:MV];
    [MV release];
    
    LBView *FM = [[LBView alloc] initWithFrame:CGRectMake(225, 114, 150, 100)];
    FM.myLabel.text = @"电台";
    [FM.myButton setBackgroundImage:[UIImage imageNamed:@"2.jpg"] forState:UIControlStateNormal];
    [FM.myButton addTarget:self action:@selector(FMClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:FM];
    [FM release];
    
    LBView *singer = [[LBView alloc] initWithFrame:CGRectMake(40, 278, 150, 100)];
    singer.myLabel.text = @"歌手";
    [singer.myButton setBackgroundImage:[UIImage imageNamed:@"5.jpg"] forState:UIControlStateNormal];
    [singer.myButton addTarget:self action:@selector(singerClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:singer];
    [singer release];
    
    LBView *songList = [[LBView alloc] initWithFrame:CGRectMake(225, 278, 150, 100)];
    songList.myLabel.text = @"歌单";
    [songList.myButton setBackgroundImage:[UIImage imageNamed:@"6.jpg"] forState:UIControlStateNormal];
    [songList.myButton addTarget:self action:@selector(songListClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:songList];
    [songList release];
}
- (void)MVClick:(UIButton *)button{
    MVViewController *mvVC = [[MVViewController alloc] init];
    [self.navigationController pushViewController:mvVC animated:YES];
    [mvVC release];
}
- (void)FMClick:(UIButton *)button{
    FMViewController *fmVC = [[FMViewController alloc] init];
    [self.navigationController pushViewController:fmVC animated:YES];
    [fmVC release];
}
- (void)singerClick:(UIButton *)button{
    SingerViewController *singerVC = [[SingerViewController alloc] init];
    [self.navigationController pushViewController:singerVC animated:YES];
    [singerVC release];
}
- (void)songListClick:(UIButton *)button{
    SongListViewController *songListVC = [[SongListViewController alloc] init];
    [self.navigationController pushViewController:songListVC animated:YES];
    [songListVC release];
}

- (void)addButtonView
{
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(WIDTH / 4 * 3, 30, self.view.frame.size.width/4, 50)];
    view.backgroundColor = [UIColor blackColor];
    [self.view addSubview:view];
    [view release];
    view.hidden = YES;
    if (self.colorNum == 1) {
        view.hidden = NO;
    }
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width/4, 50)];
    [view addSubview:label];
    [label release];
    label.text = @"音乐库";
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = [UIColor colorWithRed:38/255.0 green:100/255.0 blue:200/255.0 alpha:1];
    label.font = [UIFont systemFontOfSize:15];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
